// import Vue from 'vue/dist/vue.esm'
const Vue = globalThis.Vue
import App from './App.vue'


import 'element-ui/lib/theme-chalk/index.css';


Vue.config.productionTip = false


import VueCompositionApi, * as Lib from "@vue/composition-api";
Vue.use(VueCompositionApi);
globalThis.vueCompositionAPI = Lib
// globalThis.vueDefineCompnent = Lib.defineComponent

// import ZDataArr from "@/plugins/app-com/ZDataArr";
// Vue.component(ZDataArr.name, ZDataArr)

import * as AppComPlugin from '@/plugins/app-com/index'
AppComPlugin.install(Vue)

import {installZlayout} from "@/plugins/app-com/ZLayout/ZLayout";
installZlayout(Vue)

import {install} from "@/plugins/chinaArea";
install(Vue)

import '@/zform/initGlo'
import  { initZForm, buildVueComponentMan } from '@/zform/init';
initZForm(Vue, Vue, {
  events: {
    ['select:change']({value, self_path, curFormCon}) {
      // console.log('select:change', value, self_path)
      // console.log(curFormCon.getRefCmField('depart'))
      let refCom = curFormCon.getRefCmField('depart')
      if (refCom) {
        console.log(refCom)
      }
    }
  },
  request: {
    ['fetch'](options) {
      console.log('fetch', options)
      return Promise.resolve([
        {
          label: '测试3',
          value: '测试3'
        }
      ])
    },
    ['globalVars']() {
      return {
        userinfo: {
          deptName: '说的是多少111',
          realname: '厕所的看会手机导航'
        }
      }
    }
  }
})
globalThis.CustomCusComponent = class extends buildVueComponentMan(Vue) {}


import {initRequestLib, context} from '@/plugins/z-request/index.js';
let { request }  = initRequestLib({
  ajaxConfig: {
    baseURL: process.env.VUE_APP_API_BASEURL
  }
});
context.Message = function (...args) {
  globalThis.ElementUI.Message(...args)
}
globalThis.Req = request;



import './customZfield';

let app = new Vue({
  render: h => h(App),
}).$mount('#app');
